<template>
    <div class="newgoods">
        <h3>周一周四·新品首发</h3>
        <ul>
            <li v-for="item in newGoodsList" :key="item.id" @click="gotoDetail(item)">
                <img :src="item.list_pic_url" alt="">
                <p>{{ item.name }}</p>
                <span>{{ item.retail_price | formatMoney }}</span>
            </li>
        </ul>
    </div>
</template>

<script>
export default {
    name: "",
    props: ["newGoodsList"],
    data() {
        return {};
    },

    components: {},

    computed: {},

    created() {},

    mounted() {},

    methods: {
        gotoDetail(item){
            console.log(item);
            this.$router.push({'path':'/productDetail',query:{id:item.id}});
        }
    },
};
</script>
<style lang="less" scoped>
.newgoods{
    text-align: center;
    h3{
        height: 50px;
        line-height: 50px;
        font-size: 18px;
        color: black;
        margin-top: 25px;
    }
    ul{
        display: flex;
        flex-wrap: wrap;
        li{
            width: 50%;
            img{
                width: 100%;
                display: inline;
            }
            p{
                font-size: 16px;
                color: black
            }
            span{
                display: block;
                color: #8b0000;
                font-size: 17px;
                margin-top: 15px;
                margin-bottom:23px;
            }
        }
    }
}
</style>